const
S_Box                     : array[0..511] of DWord = (
    $91038904, $17E04119, $F1C2AD82, $9E5CEF8F, 
    $FFD6EDD0, $C85A6915, $80A3656E, $66F6372B, 
    $10A1C3DC, $C30EC751, $38A02C9A, $EEF8CB07, 
    $8BCC1728, $F83597CD, $A9C22F06, $21428723, 
    $4D1B33B4, $CDD95689, $1A2DD8B2, $8439877F, 
    $7AFDA580, $6452BF85, $CC8ED59E, $49E8281B, 
    $4717388C, $8904CEC1, $ADC411CA, $645904F7, 
    $C40CF8D8, $1358C03D, $15CBB936, $FA32FA13, 
    $9C913264, $A7FA0FF9, $87EF37E2, $D795236F, 
    $B7AF7130, $1E5279F5, $9E2F39CE, $B732DD0B, 
    $1658813C, $0445FA31, $8BEFAAFA, $7FAFC2E7, 
    $762E6E88, $FC2ECCAD, $E3E3B766, $D13BB103, 
    $85908514, $F1196D69, $8D39CB12, $7F6EC35F, 
    $B4E750E0, $5D409865, $140791FE, $D36555FB, 
    $F1309DEC, $1EC949A1, $C0F5F82A, $B21C04D7, 
    $D3CB7838, $96BEBD1D, $242D2996, $030BABF3, 
    $13842BC4, $0E4E6ED9, $FF809242, $F305674F, 
    $42E04490, $9E441AD5, $BBDADE2E, $EF4E92EB, 
    $27AA8E9C, $14C5BD11, $D5E9F95A, $74FCCAC7, 
    $37BF15E8, $954F918D, $EE0B0FC6, $1091EAE3, 
    $07172674, $EEF01449, $67768D72, $29D80F3F, 
    $B3154C40, $E4C40145, $C2AC1E5E, $77FD93DB, 
    $9711534C, $E4B25481, $1F1EAE8A, $39F114B7, 
    $D6244798, $E86849FD, $902069F6, $8EFD6DD3, 
    $86347524, $7C955DB9, $310EBCA2, $8BA5BB2F, 
    $884167F0, $2A674BB5, $24BE528E, $E6C158CB, 
    $59EFEBFC, $BF460FF1, $EC2717BA, $5AD7E2A7, 
    $6C560D48, $2ECFE66D, $C0503826, $17BD34C3, 
    $CC0717D4, $0B154B29, $DB7C1FD2, $E06D6B1F, 
    $265F97A0, $CF14FA25, $DD947ABE, $B128E1BB, 
    $781158AC, $7777EF61, $B7D634EA, $09D03497, 
    $F0EF66F8, $258D66DD, $CBBD7A56, $38803FB3, 
    $D8FA0E84, $C886DC99, $2931B702, $406E1F0F, 
    $82AADB50, $08F40C95, $17F196EE, $39032EAB, 
    $9680995C, $F27EF2D1, $583F061A, $41390A87, 
    $43CB54A8, $17E7CB4D, $C6CB3086, $63358EA3, 
    $22B85934, $2D411209, $4FE28232, $0426D6FF, 
    $D39E3300, $546B8305, $5DD8A71E, $BC5F3F9B, 
    $A788AE0C, $97D21A41, $2EB48B4A, $B3B16477, 
    $DE04D658, $4F6613BD, $BD1C5AB6, $DE0C2193, 
    $442CF7E4, $6BDAEB79, $28818162, $B45692EF, 
    $40F49EB0, $E4225D75, $C88CAB4E, $458C148B, 
    $9AB496BC, $C12865B1, $57C9C47A, $BC184267, 
    $81F6EC08, $83CF402D, $E193F8E6, $B372F883, 
    $AD82EA94, $E12B68E9, $5F41B492, $F9FC52DF, 
    $93A91E60, $10FF9BE5, $3090A37E, $9B18AD7B, 
    $0CCF536C, $2A78D521, $DB51B1AA, $4D8CA457, 
    $EB3C95B8, $4B2A509D, $BE550B16, $A2191373, 
    $54253144, $84498A59, $A3961BC2, $8E5716CF, 
    $E5F6B210, $CA2A3E55, $5DA78FAE, $2FD40A6B, 
    $F7E3E41C, $61FA6891, $DC5F52DA, $E36D8A47, 
    $7EB0D368, $89BE450D, $64C29146, $0CED7263, 
    $62BECBF4, $568C4FC9, $D831B6F2, $2AE5DEBF, 
    $535859C0, $050944C5, $36D46FDE, $12CD2B5B, 
    $633D48CC, $38242001, $C945A80A, $7159F437, 
    $FA6EA518, $E2121D7D, $9D7F8B76, $EB1F1553, 
    $E93ABAA4, $D38AB939, $43078622, $7967AAAF, 
    $A8891570, $2D43AF35, $F25A440E, $DF53104B, 
    $1366817C, $2FACFB71, $8B97B13A, $5330E227, 
    $25D10AC8, $24ECD9ED, $186EF9A6, $B81CFC43, 
    $8CC3FD54, $611BC6A9, $BD4A8952, $03DB7A9F, 
    $1383E520, $94C07DA5, $45BC0C3E, $ACF4B93B, 
    $3A2A8E2C, $ED8BFAE1, $B8286E6A, $3D115417, 
    $81730478, $C1557A5D, $9CB3DBD6, $63962733, 
    $37C59404, $BF567819, $E36DC082, $24804E8F, 
    $D383C8D0, $E3A6B015, $95BCC86E, $FF81262B, 
    $26946EDC, $A8F81E51, $BF0ADF9A, $2B5A4A07, 
    $F72F9228, $3492FECD, $38B13206, $41799623, 
    $C9EA7EB4, $7891CD89, $45242BB2, $F5D5267F, 
    $E903C080, $885D4685, $265F789E, $B707571B, 
    $F4EF238C, $9B6865C1, $1B9204CA, $52AAC3F7, 
    $8A21B3D8, $7A2C673D, $7209FC36, $F9F64913, 
    $C81DBD64, $5164C6F9, $9560CAE2, $4299026F, 
    $C5BECC30, $278B40F5, $4AE71CCE, $FFD64C0B, 
    $3EC5AC3C, $7093D131, $8450DDFA, $0FE1C1E7, 
    $06A46988, $7BE8B3AD, $75A13A66, $797B4003, 
    $0C8A5014, $B8A66469, $DA569E12, $75CAE25F, 
    $FCAFEBE0, $0C179F65, $95D6B4FE, $427D04FB, 
    $CAE308EC, $B67160A1, $1B1A6B2A, $D81E43D7, 
    $B252B338, $81CEE41D, $4799EC96, $E0B77AF3, 
    $769B36C4, $376DA5D9, $9D78A542, $8AA9C64F, 
    $F2121F90, $972961D5, $08F1412E, $13CA81EB, 
    $3D52399C, $4D381411, $9D01AC5A, $28BF49C7, 
    $FC0790E8, $A225F88D, $F35712C6, $7499F9E3, 
    $9AFB7174, $E1118B49, $1B79E072, $FCB4AE3F, 
    $8B606740, $B0278845, $4539C15E, $24CDC2DB, 
    $C75E3E4C, $D75EEB81, $9259A18A, $7763D3B7, 
    $2BDE0298, $3174F0FD, $BB7BACF6, $8E51BCD3, 
    $73960024, $C32914B9, $744D4FA2, $B7AA9A2F, 
    $DF55C2F0, $34B912B5, $BAF3358E, $32D5C7CB, 
    $D79216FC, $299CE6F1, $7EB54ABA, $21EAE1A7, 
    $13310848, $3282CD6D, $49EABB26, $8B4DC3C3, 
    $0F95E2D4, $558B4229, $DB25F2D2, $078A8A1F, 
    $E5ED32A0, $68C50125, $D9A09DBE, $F77190BB, 
    $C9B8C3AC, $BAE90661, $10E7A7EA, $5E737397, 
    $BC9BA1F8, $C6568DDD, $DFC73D56, $BD3D0EB3, 
    $43661984, $EA4F1399, $C676CA02, $88937E0F, 
    $2861B650, $66725395, $4004F9EE, $18701DAB, 
    $96DD445C, $147A49D1, $5303B91A, $2B5C8987, 
    $1BF8CFA8, $9C37324D, $85743386, $5A0E9DA3, 
    $58B1A434, $1DCB8909, $1FF2D532, $174475FF, 
    $712E4E00, $8E280A05, $EC234A1E, $17E06E9B, 
    $854A990C, $41C7B141, $DA5C7E4A, $3F452377, 
    $BE639158, $61ABBABD, $3A949DB6, $6BF17093, 
    $BE6382E4, $4697A279, $748D1462, $C05C71EF, 
    $7C0DF9B0, $F68D2475, $6B3E8E4E, $4411838B, 
    $D88BC1BC, $40883CB1, $F784F77A, $F90C4167, 
    $7A36E708, $327B272D, $260B7BE6, $C1548783, 
    $B8A6B594, $E58A5FE9, $24788792, $B0DA71DF, 
    $A5FBB960, $DC88A2E5, $09D9C67E, $A7925C7B, 
    $816BBE6C, $70B2EC21, $E65024AA, $4FD0E357, 
    $1F0DD0B8, $08AC779D, $C5FBCE16, $DCE6E273, 
    $10E63C44, $15BAC159, $93282EC2, $25FD75CF, 
    $9D328D10, $13418555, $03B7F2AE, $F931F96B, 
    $CDF58F1C, $047EBF91, $FDD105DA, $C2F20947, 
    $25C34E68, $2C86AC0D, $1FC89446, $E5978163, 
    $C5CD16F4, $FC7FC6C9, $574F09F2, $5D447DBF, 
    $112D74C0, $741ECBC5, $B3DC12DE, $8BFF5A5B, 
    $197433CC, $7062B701, $E05A9B0A, $4A0EB337, 
    $60726018, $A490C47D, $F014CE76, $96956453, 
    $BB4645A4, $39707039, $6AE01922, $846E89AF, 
    $62A77070, $4EC77635, $C489270E, $3F497F4B, 
    $7C72AC7C, $DB15D271, $AB7FE43A, $4505E127, 
    $AA7605C8, $A591C0ED, $DAC37CA6, $2F4F8B43, 
    $6A7CC854, $5663BDA9, $5B0E5C52, $A97A999F, 
    $539B8020, $D92284A5, $5F422F3E, $6E9F683B, 
    $7CBBF92C, $8D8F11E1, $2813E16A, $6BF69317, 
    $98693F78, $9AF79ED6, $6374F633, $91DB9F04);

  vk                        : array[0..6] of DWord = (
    $93361840, $8E97FD45, $41C00A5E, $99112FDB, 
    $38E35F4C, $BBFC9081, $7A81DA8A);
